package com.qfedu.index.tolist.service.controller;

import com.qfedu.entity.Special;
import com.qfedu.index.tolist.service.service.SpecialService;
import com.qfedu.vo.ResultVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SpecialController {
    @Resource
    private SpecialService specialService;

    @RequestMapping("/getSpecial")
    public ResultVo getSpecial(){
        List<Special> allSpecial = specialService.getAllSpecial();
        return ResultVo.getSuccessResultVo("查询成功",allSpecial);
    }

    @RequestMapping("/getSpecialById")
    public ResultVo getSpecialById(Integer specialId){
        Special special = specialService.getSpecialById(specialId);
        return ResultVo.getSuccessResultVo("查询成功",special);
    }
}
